[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FOPEN IEXP1,SEXP,IEXP2,IEXP3

 Function
  Use channel IEXP1 to open file SEXP in access mode IEXP2 and
  share mode IEXP3
  (valid channels = 0 - 7 [0 is used for script questionnaires])
  (valid access modes = O_RD, O_WR, O_RW)
  (valid share modes = S_DN, S_DR, S_DW, S_DB)

 Syntax
  FOPEN chan,file,am,sm

   chan  - An integer expression with the channel to use for the file
           (0 through 7).
   file  - A string expression with the file specification to open.
   am    - An integer expression with the desired access mode for the file.
   sm    - An integer expression with the desired share mode flags for
           the file.

 Remarks
  This statement allows a PPL application to open a file for read and/or
  write access and to specify the method of sharing desired.  The chan
  parameter must be 0 through 7; 0 is reserved for the answer file when a
  PPL script questionnaire is in use but is available for all other
  applications.  However, it is recommended you avoid channel 0 unless you
  really need to open 8 files at once.  The am parameter should be one of
  the following constants:

   O_RD   open with read access
   O_WR   open with write access
   O_RW   open with read/write access

  Note that the O_RD constant expects the file to already exist; the other
  open constants will create the file if it already doesn't exist.
  The sm parameter should be one of the following constants:

   S_DN   deny none sharing
   S_DR   deny read sharing
   S_DW   deny write sharing
   S_DB   deny both sharing

 Examples
  STRING hdr
  FOPEN 1,"C:\PCB\MAIN\PPE.LOG",O_RD,S_DW
  FGET 1,hdr
  FCLOSE 1
  IF (hdr <> "Creating PPE.LOG file . . .") THEN
   PRINTLN "Error: PPE.LOG invalid"
   END
  ENDIF

See Also: FAPPEND FCLOSE FCREATE FREWIND
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson